﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

#nullable disable

namespace SystemHYS.Infrstructre.Migrations
{
    /// <inheritdoc />
    public partial class 出库 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<int>(
                name: "state",
                table: "Rawmaterialtestings",
                type: "integer",
                nullable: true,
                oldClrType: typeof(bool),
                oldType: "boolean",
                oldNullable: true);

            migrationBuilder.CreateTable(
                name: "Delivery",
                columns: table => new
                {
                    deliveryId = table.Column<int>(type: "integer", nullable: false)
                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
                    deliveryName = table.Column<string>(type: "text", nullable: true),
                    deliveryNumber = table.Column<string>(type: "text", nullable: false),
                    deliveryDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
                    orderNumber = table.Column<string>(type: "text", nullable: true),
                    remark = table.Column<string>(type: "text", nullable: true),
                    finishedProductName = table.Column<string>(type: "text", nullable: true),
                    finishedProductNumber = table.Column<string>(type: "text", nullable: true),
                    specification = table.Column<string>(type: "text", nullable: true),
                    unit = table.Column<string>(type: "text", nullable: true),
                    productionNumber = table.Column<string>(type: "text", nullable: true),
                    outboundQuantity = table.Column<int>(type: "integer", nullable: false),
                    warehouseName = table.Column<string>(type: "text", nullable: true),
                    dateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    warehousePerson = table.Column<string>(type: "text", nullable: true),
                    state = table.Column<int>(type: "integer", nullable: true),
                    isDel = table.Column<bool>(type: "boolean", nullable: false),
                    AddName = table.Column<string>(type: "text", nullable: true),
                    AddTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    UpdateName = table.Column<string>(type: "text", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    DelectName = table.Column<string>(type: "text", nullable: true),
                    DelectTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Delivery", x => x.deliveryId);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Delivery");

            migrationBuilder.AlterColumn<bool>(
                name: "state",
                table: "Rawmaterialtestings",
                type: "boolean",
                nullable: true,
                oldClrType: typeof(int),
                oldType: "integer",
                oldNullable: true);
        }
    }
}
